package o;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import androidx.annotation.NonNull;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.fastengine.fastview.FastSDKEngine;
import com.huawei.fastengine.fastview.startFastappEngine.bean.RpkInfo;
import o.ewm.h;
import o.ewm.j;
import o.ewm.n;

public class eaa implements ewa {
    private cku ˊ;
    private BaseCardBean ˎ;
    private View ˏ;
    private Context ॱ;

    public eaa(@NonNull Context context, BaseCardBean baseCardBean) {
        this.ॱ = context;
        this.ˎ = baseCardBean;
        this.ˊ = cku.ˋ(context.getString(n.ʼʽ), context.getString(n.ͺﹳ));
        this.ˏ = LayoutInflater.from(context).inflate(h.ـᐝ, null);
        int ˎ = ewb.ˎ((Activity) this.ˏ.getContext());
        this.ˏ.setPadding(ˎ, 0, ˎ, 0);
        this.ˊ.ˊ(this.ˏ);
        this.ˊ.setCancelable(false);
        this.ˊ.ॱ(-2, context.getString(n.ˊˈ));
        this.ˊ.ॱ(-1, context.getString(n.ʻʻ));
        this.ˊ.ˋ((ewa) this);
    }

    public void ˏ(Activity activity, DialogInterface dialogInterface, int i) {
        if (i == -1) {
            if (ॱ()) {
                eua.ˏ().ˋ("h5_to_fastapp_not_remind", true);
            }
            if (this.ˎ != null) {
                djx.ˊ(this.ˎ.ॱॱ(), this.ॱ);
                RpkInfo rpkInfo = new RpkInfo();
                rpkInfo.setPackageName(this.ˎ.ॱـ());
                FastSDKEngine.launchFastAppFromAppGallery(this.ॱ, rpkInfo);
                dzz.ˋ(this.ˎ.showDetailUrl_);
            }
        } else if (i == -2) {
            if (cku.ˏ(activity, "h5FastAppWarningDialog")) {
                cku.ˎ((Context) activity, "h5FastAppWarningDialog");
            }
            if (this.ˎ != null) {
                dzz.ॱ(this.ˎ.showDetailUrl_);
            }
        }
    }

    public void ॱ(Context context) {
        if (!(this.ˊ == null || this.ˊ.isAdded())) {
            this.ˊ.ˋ(context, "h5FastAppWarningDialog");
        }
        if (this.ˎ != null) {
            dzz.ˏ(this.ˎ.showDetailUrl_);
        }
    }

    private boolean ॱ() {
        if (this.ˏ != null) {
            CheckBox checkBox = (CheckBox) this.ˏ.findViewById(j.ʻʼ);
            if (checkBox != null) {
                return checkBox.isChecked();
            }
        }
        return false;
    }

    public void ˊ(Activity activity, DialogInterface dialogInterface) {
    }
}
